<template v-slot:tablevue>
  <div class="homeButton">
    <van-sidebar v-model="activeKey">
      <van-tabbar
        v-model="active"
        class="sss"
        active-color="#ee0a24"
        inactive-color="#000"
        fixed
      >
        <van-tabbar-item class="sss" icon="home-o" @click="$router.push('/home')"
          >首页</van-tabbar-item
        >
        <van-tabbar-item
          class="sss"
          icon="search"
          @click="$router.push({ path:'/category' })"
          >分类</van-tabbar-item
        >
        <van-tabbar-item
          class="sss"
          icon="friends-o"
          @click="gocar"
          >购物车</van-tabbar-item
        >
          <van-tabbar-item
            icon="setting-o"
            class="sss"
            @click="gouser"
            >我的</van-tabbar-item
          >
      </van-tabbar>
    </van-sidebar>
  </div>
</template>

<script>
import store from '@/store'
export default {
     data() {
    return {
      active: 0,
      activeKey:''
    };
  },
  methods:{
    gocar(){
      if(store.getters.getisLogin){
        this.$router.push('/car')
      }else{
        this.$router.push('/login')
      }
    },
    gouser(){
      if(store.getters.getisLogin){
        this.$router.push('/user')
      }else{
        this.$router.push('/login')
      }
    }
  }
};
</script>
